package org.springblade.modules.admin.vo.plan.store;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.modules.admin.entity.MaintainByScoreQuestion;
import org.springblade.modules.admin.service.IMaintainByScoreQuestionService;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author zcc
 * @version 1.0
 * @date 2024/5/15 10:29
 */
@Data
public class ByProblemResultVo extends MaintainByScoreQuestion {

	@ApiModelProperty("工单id")
	private Long planId;

	@ApiModelProperty("项目名称")
	private String buildingName;

	@ApiModelProperty("项目id")
	private Long buildingId;

	@ApiModelProperty("电梯地址")
	private String elevatorAddress;

	@ApiModelProperty("实际执行人")
	private String userNames;

	@ApiModelProperty("创建人")
	private String createUserName;

	@ApiModelProperty("电梯地址")
	private Long elevatorId;

	@ApiModelProperty("完成时间")
	private Date planEndTime;

	@ApiModelProperty("问题点总数")
	private Integer problemCounts;

	@ApiModelProperty("待处理问题点总数")
	private Integer disProblemCounts;

	@ApiModelProperty("已处理问题点总数")
	private Integer enProblemCounts;

	private String questionIds;

	private List<Long> queIds;

	/**
	 * 1-可申诉 2-不可申诉
	 */
	private Integer appealType;

	/**
	 * 1-待申诉 2-已申诉
	 */
	private Integer appealStatus;

	/**
	 * 1-待审核 2-审核通过 3-审核不通过
	 */
	private Integer appealResult;

	@ApiModelProperty("问题列表")
	List<MaintainByScoreQuestion> list;

	@ApiModelProperty("用户id")
	private String userIds;

	@ApiModelProperty("1:合规0:不合规")
	private Integer isPass = 1;

	public void setQuestionIds(String questionIds) {
		this.questionIds = questionIds;
		if (StrUtil.isNotEmpty(questionIds)) {
			List<Long> ids = new ArrayList<>(16);
			List<String> list = Arrays.asList(questionIds.split(","));
			for (String id : list) {
				ids.add(Convert.toLong(id));
			}
			this.queIds = ids;
		}
	}

}
